import { deleteFolder, lookup, searchFolderUp } from "./tool/scanutil";
import { consts } from "../pkg-00-const";

export const build = function () {
  lookup(__dirname, /^scanner/).forEach(runScanner);
  deleteFolder(searchFolderUp(consts.prebuildOutDir));
};
const getScanner = (modulePath: string) => require(modulePath).scanner as { scan: () => void };
const runScanner = (modulePath: string) => getScanner(modulePath).scan();
